#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include <stdio.h>
using namespace std;
const int N = 20;
bool st[N];
int n, t;

struct plane {
    int dao, pan, luo;
}p[N];

bool dfs(int pnum, int time)
{
    if (pnum == n)return true;
    for (int i = 1; i <= n; i++)
    {
        if (st[i] == true) continue;
        if (p[i].dao + p[i].pan >= time)
        {
            st[i] = true;
            int ti = max(time, p[i].dao) + p[i].luo;
            if (dfs(pnum + 1, ti)) return true;
            st[i] = false;
        }
    }
    return false;
}
int main()
{
    cin >> t;
    while (t--)
    {
        cin >> n;
        for (int i = 1; i <= n; i++)
        {
            cin >> p[i].dao >> p[i].pan >> p[i].luo;
        }
        memset(st, false, sizeof(st));
        if (dfs(0, 0)) cout << "YES" << '\n';
        else cout << "NO" << '\n';
    }

    return 0;
}